home *** CD-ROM | disk | FTP | other *** search
/ BCI NET / BCI NET Dec 94.iso / archives / programming / source / fbm12s.lha / README < prev    next >
Encoding:
Text File  |  1994-07-18  |  8.3 KB  |  221 lines

  1. This directory contains Release 1.2 of the Fuzzy Pixmap Manipulation
  2. (FBM) library of programs.  This collection provides a complete package
  3. for manipulating and converting color and black and whites images,
  4. including 24bit RGB, 8bit mapped color, 8bit grayscale, and 1bit
  5. bitmapped images.
  6.  
  7. Compilation
  8.  
  9.     Unpack all files in one directory.  Edit Makefile and put in
  10.     appropriate values for defaults.
  11.  
  12.     If you wish to have the tiff2fbm and fbm2tiff programs, first
  13.         obtain, unpack, and compile libtiff.a, and then modify FBM 's
  14.     Makefile to include this library.  Then type "make tiff".  Note
  15.     that some versions of libtiff are not careful to put file
  16.     tiffcompat.h into the intstall directory.  The tifflib is
  17.     available from UCBVAX.BERKELEY.EDU, file pub/tiff/v3.0.tar.Z.
  18.  
  19.     If you have the Utah Raster Toolkit, the 'fbcat' program can be
  20.     compiled with the -DRLE flag to include support for RLE files.
  21.     Credit for RLE support to Paul Milazzo <milazzo@pearl.bbn.com>.
  22.     Get the Toolkit from CS.UTAH.EDU, file pub/toolkit-2.0.tar.Z.
  23.  
  24.     Get Jef Poskanzer's PBMPLUS source from EXPO.LCS.MIT.EDU, file
  25.     contrib/pbmplus.tar.Z.
  26.  
  27.  
  28. File Formats
  29.  
  30.     FBM   (-F)    FBM file with 256 byte header (with title & credits)
  31.     Sun   (-S)    Sun rasterfile with 32 byte header
  32.     Tiff  (-T)    Aldus TIFF
  33.     PBM   (-P)    Poskanzer format for 1bit files
  34.     GIF   (-G)    CompuServe GIF format
  35.     JPG   (-J)    JPEG JFIF format (cf The Independent JPEG Group)
  36.     RLE   (-R)    Utah RLE format
  37.     IFF   (-I)    Amiga IFF files (except HAM mode files)
  38.     PCX   (-Z)    PC PaintBrush format for IBM
  39.     Face  (-B)    Bennet Yee's 1bit files, used at CMU
  40.  
  41.     All programs (except fbinfo) can read any of the formats, and use
  42.     the magic number to decide the file type.  If the input is not a
  43.     pipe and is compressed using the net standard 'compress' program,
  44.     the file will be uncompressed as it is read.  Note however that 
  45.     the operation to be performed must make sense; that is you cannot
  46.     halftone a color image, quantize a grayscale image, or resize a
  47.     1bit file.
  48.  
  49. Files and Programs:
  50.  
  51.     README        This file
  52.     README.lib    Lists the subroutines in libfbm.a
  53.     Makefile    Make utility configuration file
  54.     fbm.1        General manual entry
  55.     *.1        Individual manual entries
  56.     fbm.h        Defines FBM data structures
  57.  
  58.     clr2gray  Convert color to grayscale
  59.     fbcat      Copy image (used for format conversion)
  60.     fbclean      Flip isolated pixels (clean image)
  61.     fbconv      Arbitrary convolutions
  62.     fbedge      Compute derivative image (edge detection)
  63.     fbext      Extract region, resize, change aspect ratio
  64.     fbgamma      Gamma correct grayscale or color image for display
  65.     fbhalf      Halftone grayscale image (Blue noise, Floyd-Steinberg, etc)
  66.     fbham      Convert FBM 24bit RGB to Amiga HAM mode
  67.     fbhist      Compute histogram
  68.     fbinfo      Dump image header
  69.     fbm2pod      Convert grayscale image to Diablo graphics (!)
  70.     fbm2tga      Convert image to Targa format
  71.     fbm2tiff  Convert FBM files to 1, 2, 4, 8, or 24 bit TIFF
  72.     fbmask      Set region to gray value
  73.     fbmedian  Median filter 3x3 regios
  74.     fbnorm      Normalize image intensity / increase contrast
  75.     fbpalet      Replace an imager's colormap with another, remove duplicates
  76.     fbps      Convert to PostScript
  77.     fbquant      Color quantization (24 bit to 8..256 colors) Mod. Heckbert
  78.     fbrot      Rotate 90, 180, or 270 degrees
  79.     fbthin      Thin 1bit images
  80.     fbsample  Sample a 1bit file to produce an 8bit file
  81.     fbsharp      Sharpen (edge enhancement) by digital Laplacian
  82.     gray2clr  Add a "gray" colormap to a grayscale image
  83.     idiff      (and udiff) convert raw byte stream into byte difference
  84.     pbm2ps      Convert PBM file to PostScript
  85.     pbmtitle  Add a title to a PBM file
  86.     raw2fbm      Convert raw file to FBM format (eg: Amiga Digiview files)
  87.     tga2fbm   Convert Targa file to FBM format
  88.     tiff2fbm  Convert tiff file to FBM format
  89.     uunet2fbm Convert UseNet Facesaver file to FBM format
  90.  
  91. Extensions
  92.  
  93.     Several file extension conventions are used, but none are enforced
  94.  
  95.     .Z        Compressed file, appended to other extensions
  96.  
  97.     .fbm        Standard extension for FBM format files
  98.     .cbm        Sometimes used to mean a 24bit color FBM file
  99.  
  100.     .ip        8bit grayscale Amiga file (with 1.2 aspect ratio)
  101.     .cp        24bit color Amiga file (with 1.2 aspect ratio)
  102.  
  103.     .1bit        Sun 1bit rastefile
  104.     .clr        Sometimes used to mean a 8bit mapped color Sun file
  105.  
  106.     .bm        Bennet Yee's "Face" format (1bit)
  107.     .pbm        Poskanzer 1bit format
  108.     .gif        Compuserve GIF format
  109.  
  110.     .jpg or .jpeg    JPEG JFIF format
  111.     .pcx        ZSoft's PCPaintbrush format
  112.     .tif or .tiff    Aldus's TIFF format (used on NeXT)
  113.  
  114. Example Unix pipelines to view files:
  115.  
  116.     Starting with an 8 bit raw Amiga grayscale file, foo.ip, first
  117.     create an FBM format file with a title and credit, then process
  118.     that file for viewing on a Sun screen by normalizing, rotating,
  119.     resizing, sharpening, and halftoning.
  120.  
  121.     % raw2fbm -d1 -a1.2 -w640 -h400 \
  122.       -t'Random Title' -c'Random Credit' < foo.ip > foo.fbm
  123.  
  124.     % fbinfo foo.fbm
  125.     foo.fbm            "Random Title"
  126.             [ Random Credit ]
  127.             [640x400x8]    8 physbits  1.2 aspect ratio
  128.             row length 640, plane length 256000, colormap length 0
  129.  
  130.  
  131.     % fbnorm < foo.fbm | \            (normalize)
  132.       fbrot | \                (rotate 90 deg clockwise)
  133.       fbext -a1 -W900 -H768 | \        (resize & make aspect ratio 1)
  134.       fbhalf -s10 -S > foo.1bit        (sharpen, halftone, write Sun)
  135.  
  136.  
  137.  
  138.     Starting with a 24 bit color Amiga file, bar.cp, first create an
  139.     FBM format file with title and credit, then render that file for
  140.     viewing on a Sun by normalizing, rotating, sharpening, and
  141.     quantizing.
  142.  
  143.     % raw2fbm -d3 -a1.2 -w640 -h400 \
  144.       -t'Random Color Title' -c'Random Color Credit' < bar.cp > bar.cbm
  145.  
  146.     % fbinfo bar.cbm
  147.     bar.cbm            "Random Color Title"
  148.             [ Random Color Credit ]
  149.             [3x640x400x8]    8 physbits  1.2 aspect ratio
  150.             row length 640, plane length 256000, colormap length 0
  151.  
  152.  
  153.     % fbnorm < bar.cbm | \            (normalize)
  154.       fbrot | \                (rotate 90 deg clockwise)
  155.       fbext -a1 -W900 -H768 | \        (resize & make aspect ratio 1)
  156.       fbsharp 3.0 | \            (sharpen it)
  157.       fbquant -S > bar.clr            (quantize and write Sun)
  158.  
  159.     (Note that sharpening is an integral option to the halftoning
  160.      program using the -s option, but that color images must currently
  161.      be sharpened using a separate program.  Note also that more
  162.      sharpening is used on black and white images than on color images).
  163.  
  164.       Starting with a 256 color Sun raster image, baz.clr, generate a NeXT
  165.     readable 2bit grayscale image (note fbm2tiff is not a filter, but
  166.     writes to a named file.  Tiff2fbm reads a named file):
  167.  
  168.             -- Without Dithering --
  169.       % clr2gray < baz.clr | \            (convert to gray)
  170.     fbm2tiff -N baz.tiff            (chop 8bit grays to 2bit)
  171.  
  172.             -- With Dithering (note 1) --
  173.       % clr2gray < baz.clr | \            (convert to gray)
  174.     fbnorm | \                (normalize, optional)
  175.     unmap | \                (convert to RGB)
  176.     fbquant -c4 | \                (fbquant also dithers RGB)
  177.     clr2gray | \                (back to gray: 0, 85, 190, 255)
  178.     fbm2tiff -N baz.tiff            (convert 4 grays to NeXT 2bit)
  179.  
  180.     Note 1: Yes, this is gross...and inefficient.  But the
  181.     images look fine.  Dithering should be an option of fbm2tiff,
  182.     and really the halftoning algorithms should be generalized
  183.     to produce more than just bitmaps.
  184.  
  185. Notes on the 'fbext' program
  186.  
  187.     Usage:    fbext [ -w<width> -h<height> -W<maxwdith> -H<maxheight>
  188.                 -s<size> -a<aspect> -t'title' -c'credits' ]
  189.              [ x y [ width height ] ]
  190.         < foo.fbm > bar.fbm
  191.  
  192.     fbext (bitmap extract) is a very useful anmd multipurpose program.
  193.     Its basic operation is to copy a rectangular portion of one image
  194.     (color or black and white) to a second image, possibly changing
  195.     either the width or height or both.  It can also change the title
  196.     or credits fields of the image.  Because it is so versatile, there
  197.     are a host of options:
  198.  
  199.     -w<num>  or  -h<num>    Force width and/or height to a certain size
  200.     -W<num>  or  -H<num>    Limit width and height to a certain size
  201.     -a<num>            Force the output to have a given aspect ratio
  202.     -s<num>            Scale image to have no more than a given
  203.                 number of pixels.
  204.     <x0> <y0> <width> <height>  select a rectangular region of the image
  205.                 to extract.  The default is the entire image.
  206.  
  207.     Note that the output size limits are cumulative.  Thus if you set a
  208.     maximum width, height, and number of pixels, the image will be the
  209.     smallest of the three limits.
  210.  
  211. Notes on JPEG support
  212.  
  213.     All routines support JPEG output, but not all routines actually
  214.     produce the 8 bit grayscale or 24 bit RGB color suitable for
  215.     writing to JPEG format.  In those cases, the JPEG routines will
  216.     complain.
  217.     
  218.     Only the fbcat(1) program supports the -q<quality> switch
  219.     which allows you to specify a JPEG quality other than the 
  220.     default of 75.
  221.